{% extends './layout.html'%} {%block main%}

<style>
	h6 {
		margin-bottom: 10px;
	}
	
	body {
		padding: 10px;
	}
	
	html,
	body {
		height: 100%;
	}
	
	label {
		margin-bottom: 8px;
		display: block;
	}
</style>
<form class='layui-form' id='app' method='post'>

	<input type="hidden" name='id' value='{{proxy.id}}' />
	<div class="layui-form-item">
		<label class="">
			可出金额
		</label>
		<div class="">

			<input type="nickname" class="layui-input newsName" name='nickname' value='{{limit}}' disabled="" placeholder="">
			<!--<select name="" lay-verify="">
				<option value="vip">VIP会员</option>
			</select>  -->
		</div>
	</div>
	<div class="layui-form-item">
		<label class="">需出金额</label>
		<div class="">
			<input type="number" class="layui-input newsName" max="{{limit}}" name='money' value='{{proxy.nickname}}'  placeholder="">
		</div>
	</div>

	<!--<div class="layui-form-item">
		<label class="">IP地址</label>
		<div class="">
			<input type="text" class="layui-input newsName" name='ip' value='{{info.ip}}' lay-verify="required|ip" placeholder="用户IP(例如：187.21.22.34)">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="">手机号</label>
		<div class="">
			<input type="text" class="layui-input newsName" name='phone' value='{{info.phone}}' lay-verify="required|phone" placeholder="">
		</div>
	</div>
	<div class="layui-form-item">
		<div>
			<label class="">备注</label>
		</div>

		<div class="">
			<textarea class="layui-textarea  newsName" name='ps' >{{info.ps}}</textarea>
		</div>
	</div>-->

	<!--<div class="layui-form-item">
		<label class="">公司名称</label>
		<div class="">
			<input type="text" class="layui-input newsName" lay-verify="required" placeholder="公司名称">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="">所属账号</label>
		<div class="">
			<input type="text" class="layui-input newsName" lay-verify="required" placeholder="账号名称">
		</div>
	</div>
	<div class="layui-container">
		<div class="layui-row">
		<div class="layui-col-sm6">
			<h6>手续费比例（%）</h6>
			<input type="text" value="000000" class="layui-input search_input">
		</div>
		<div class="layui-col-sm6">
			<h6>手续费比例（%）</h6>
			<input type="text" value="000000" class="layui-input search_input">
		</div>
	</div>
	</div>-->

	<!--<div class="layui-form-item">
		<label class="">&nbsp;</label>
		<div class="layui-inline">
			<div class="layui-input-inline">
			<h6>手续费比例（%）</h6>
			<input type="text" value="000000" class="layui-input search_input">
			</div>
		</div>
		
		<div class="layui-inline">
			<div class="layui-input-inline">
			<h6>货款分摊比例（%）</h6>
			<input type="text" value="000000" class="layui-input search_input">
			</div>
		</div>
		
	</div>
	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="">自定义属性</label>
			<div class="">
				<input type="checkbox" name="tuijian" class="tuijian" title="推荐">
				<input type="checkbox" name="shenhe" class="newsStatus" title="审核">
				<input type="checkbox" name="show" class="isShow" title="展示">
			</div>
		</div>
		<div class="layui-inline">
			<label class="">文章作者</label>
			<div class="layui-input-inline">
				<input type="text" class="layui-input newsAuthor" lay-verify="required" placeholder="请输入文章作者">
			</div>
		</div>
		<div class="layui-inline">
			<label class="">发布时间</label>
			<div class="layui-input-inline">
				<input type="text" class="layui-input newsTime" lay-verify="required|date" onclick="layui.laydate({elem:this})">
			</div>
		</div>
		<div class="layui-inline">
			<label class="">浏览权限</label>
			<div class="layui-input-inline">
				<select name="browseLook" class="newsLook" lay-filter="browseLook">
					<option value="0">开放浏览</option>
					<option value="1">会员浏览</option>
				</select>
			</div>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="">关键字</label>
		<div class="">
			<input type="text" class="layui-input" placeholder="请输入文章关键字">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="">内容摘要</label>
		<div class="">
			<textarea placeholder="请输入内容摘要" class="layui-textarea"></textarea>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="">文章内容</label>
		<div class="">
			<textarea class="layui-textarea layui-hide" name="content" lay-verify="content" id="news_content"></textarea>
		</div>
	</div>-->
	<div class="layui-form-item">
		<div class="">
			<button class="layui-btn" lay-submit="" lay-filter="addNews">立即提交</button>
			<!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
		</div>
	</div>
</form>
{%endblock%} {%block js%}
<script>
	setTimeout(function() {
		var val = $('[name=parent_id]').attr('value');
		val = Number(val)
		if(val > -1) {
			$('dl dd[lay-value=' + val + ']').trigger('click')

		}

	}, 500);

	layui.use('form', function() {
		var form = layui.form;

		form.verify({

			ip: [
				/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/, 'IP地址错误'
			],
			phone: [
				/^1[34578]\d{9}$/,
				"手机号码格式错误"
			]

		});

		//监听提交
		form.on('submit(addNews)', function(data) {
			console.log(data)
			$.post("/proxy/api/addCash", data.field, function(json) {
				if(json.success) {
					layer.msg("保存成功", {
						icon: 1
					}, function() {
						parent.location.reload();

					})
				} else {
					layer.msg(json.msg);
				}
			}, 'json');
			//			layer.msg(JSON.stringify(data.field));
			return false;
		});
	});
</script>
<script type="text/html">
	var info; try{ info = eval('({{info | dump | safe}})'); } catch(e){ } var app = new Vue({ el : '#app', data : { name : 1, password : 2 } }) if(info){ for(var i in info){ app[i] = info[i]; } }
</script>
{%endblock%}